Linux CLI on the FLY (interface stats)
I am going to start a new section of Linux CLI foo that you may or may not know about. Many of these will be faster ways of doing things or getting information in a slightly different fashion. Many are old favorites of mine that I just wanted to share in case they help someone else.
Now without further ado the first command is :
ip -s l
short for ip stats list this gives a fast overview of your interfaces and the types of packets that have been going through them. Output looks like this :
[root@pbnj lisa11]# ip -s l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped overrun mcast
1084866683 400954 0 0 0 0
TX: bytes packets errors dropped carrier collsns
1084866683 400954 0 0 0 0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:30:48:61:c7:64 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
552827144 1541759 0 0 0 0
TX: bytes packets errors dropped carrier collsns
1428902993 1445402 0 0 0 0
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:30:48:61:c7:65 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
More information on interface stats can be found via:
ethtool -S $DEVICE
ifconfig $device (or just ifconfig for all devices)
ifconfig -s $DEVICE
among others….